3.303 \(\int (f+\frac{g}{x}) x (a+b \log (c (d+e x)^n)) \, dx\)

Optimal. Leaf size=91 \[ \frac{(f x+g)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}-\frac{b n (d f-e g)^2 \log (d+e x)}{2 e^2 f}+\frac{b n x (d f-e g)}{2 e}-\frac{b n (f x+g)^2}{4 f} \]

[Out]

(b*(d*f - e*g)*n*x)/(2*e) - (b*n*(g + f*x)^2)/(4*f) - (b*(d*f - e*g)^2*n*Log[d + e*x])/(2*e^2*f) + ((g + f*x)^
2*(a + b*Log[c*(d + e*x)^n]))/(2*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0639724, antiderivative size = 91, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {2412, 2395, 43} \[ \frac{(f x+g)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}-\frac{b n (d f-e g)^2 \log (d+e x)}{2 e^2 f}+\frac{b n x (d f-e g)}{2 e}-\frac{b n (f x+g)^2}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[(f + g/x)*x*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

(b*(d*f - e*g)*n*x)/(2*e) - (b*n*(g + f*x)^2)/(4*f) - (b*(d*f - e*g)^2*n*Log[d + e*x])/(2*e^2*f) + ((g + f*x)^
2*(a + b*Log[c*(d + e*x)^n]))/(2*f)

Rule 2412

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)/(x_))^(q_.)*(x_)^(m_.), x_Symbol]
 :> Int[(g + f*x)^q*(a + b*Log[c*(d + e*x)^n])^p, x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p, q}, x] && EqQ[m,
q] && IntegerQ[q]

Rule 2395

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[((f + g
*x)^(q + 1)*(a + b*Log[c*(d + e*x)^n]))/(g*(q + 1)), x] - Dist[(b*e*n)/(g*(q + 1)), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \left (f+\frac{g}{x}\right ) x \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx &=\int (g+f x) \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx\\ &=\frac{(g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}-\frac{(b e n) \int \frac{(g+f x)^2}{d+e x} \, dx}{2 f}\\ &=\frac{(g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}-\frac{(b e n) \int \left (\frac{f (-d f+e g)}{e^2}+\frac{(-d f+e g)^2}{e^2 (d+e x)}+\frac{f (g+f x)}{e}\right ) \, dx}{2 f}\\ &=\frac{b (d f-e g) n x}{2 e}-\frac{b n (g+f x)^2}{4 f}-\frac{b (d f-e g)^2 n \log (d+e x)}{2 e^2 f}+\frac{(g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}\\ \end{align*}

Mathematica [A]  time = 0.0555758, size = 101, normalized size = 1.11 \[ \frac{1}{2} a f x^2+a g x+\frac{1}{2} b f x^2 \log \left (c (d+e x)^n\right )+\frac{b g (d+e x) \log \left (c (d+e x)^n\right )}{e}-\frac{b d^2 f n \log (d+e x)}{2 e^2}+\frac{b d f n x}{2 e}-\frac{1}{4} b f n x^2-b g n x \]

Antiderivative was successfully verified.

[In]

Integrate[(f + g/x)*x*(a + b*Log[c*(d + e*x)^n]),x]

[Out]

a*g*x + (b*d*f*n*x)/(2*e) - b*g*n*x + (a*f*x^2)/2 - (b*f*n*x^2)/4 - (b*d^2*f*n*Log[d + e*x])/(2*e^2) + (b*f*x^
2*Log[c*(d + e*x)^n])/2 + (b*g*(d + e*x)*Log[c*(d + e*x)^n])/e

________________________________________________________________________________________

Maple [A]  time = 0.086, size = 101, normalized size = 1.1 \begin{align*} agx+{\frac{af{x}^{2}}{2}}+bg\ln \left ( c \left ( ex+d \right ) ^{n} \right ) x-bgnx+{\frac{bdgn\ln \left ( ex+d \right ) }{e}}+{\frac{bf{x}^{2}\ln \left ( c{{\rm e}^{n\ln \left ( ex+d \right ) }} \right ) }{2}}-{\frac{nbf{x}^{2}}{4}}-{\frac{{d}^{2}bfn\ln \left ( ex+d \right ) }{2\,{e}^{2}}}+{\frac{bdfnx}{2\,e}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f+g/x)*x*(a+b*ln(c*(e*x+d)^n)),x)

[Out]

a*g*x+1/2*a*f*x^2+b*g*ln(c*(e*x+d)^n)*x-b*g*n*x+b*g/e*n*d*ln(e*x+d)+1/2*b*f*x^2*ln(c*exp(n*ln(e*x+d)))-1/4*n*b
*f*x^2-1/2*n*b*d^2*f/e^2*ln(e*x+d)+1/2*b*d*f*n*x/e

________________________________________________________________________________________

Maxima [A]  time = 1.05571, size = 138, normalized size = 1.52 \begin{align*} -b e g n{\left (\frac{x}{e} - \frac{d \log \left (e x + d\right )}{e^{2}}\right )} - \frac{1}{4} \, b e f n{\left (\frac{2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac{e x^{2} - 2 \, d x}{e^{2}}\right )} + \frac{1}{2} \, b f x^{2} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac{1}{2} \, a f x^{2} + b g x \log \left ({\left (e x + d\right )}^{n} c\right ) + a g x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)*x*(a+b*log(c*(e*x+d)^n)),x, algorithm="maxima")

[Out]

-b*e*g*n*(x/e - d*log(e*x + d)/e^2) - 1/4*b*e*f*n*(2*d^2*log(e*x + d)/e^3 + (e*x^2 - 2*d*x)/e^2) + 1/2*b*f*x^2
*log((e*x + d)^n*c) + 1/2*a*f*x^2 + b*g*x*log((e*x + d)^n*c) + a*g*x

________________________________________________________________________________________

Fricas [A]  time = 1.95898, size = 267, normalized size = 2.93 \begin{align*} -\frac{{\left (b e^{2} f n - 2 \, a e^{2} f\right )} x^{2} - 2 \,{\left (2 \, a e^{2} g +{\left (b d e f - 2 \, b e^{2} g\right )} n\right )} x - 2 \,{\left (b e^{2} f n x^{2} + 2 \, b e^{2} g n x -{\left (b d^{2} f - 2 \, b d e g\right )} n\right )} \log \left (e x + d\right ) - 2 \,{\left (b e^{2} f x^{2} + 2 \, b e^{2} g x\right )} \log \left (c\right )}{4 \, e^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)*x*(a+b*log(c*(e*x+d)^n)),x, algorithm="fricas")

[Out]

-1/4*((b*e^2*f*n - 2*a*e^2*f)*x^2 - 2*(2*a*e^2*g + (b*d*e*f - 2*b*e^2*g)*n)*x - 2*(b*e^2*f*n*x^2 + 2*b*e^2*g*n
*x - (b*d^2*f - 2*b*d*e*g)*n)*log(e*x + d) - 2*(b*e^2*f*x^2 + 2*b*e^2*g*x)*log(c))/e^2

________________________________________________________________________________________

Sympy [A]  time = 2.91779, size = 148, normalized size = 1.63 \begin{align*} \begin{cases} \frac{a f x^{2}}{2} + a g x - \frac{b d^{2} f n \log{\left (d + e x \right )}}{2 e^{2}} + \frac{b d f n x}{2 e} + \frac{b d g n \log{\left (d + e x \right )}}{e} + \frac{b f n x^{2} \log{\left (d + e x \right )}}{2} - \frac{b f n x^{2}}{4} + \frac{b f x^{2} \log{\left (c \right )}}{2} + b g n x \log{\left (d + e x \right )} - b g n x + b g x \log{\left (c \right )} & \text{for}\: e \neq 0 \\\left (a + b \log{\left (c d^{n} \right )}\right ) \left (\frac{f x^{2}}{2} + g x\right ) & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)*x*(a+b*ln(c*(e*x+d)**n)),x)

[Out]

Piecewise((a*f*x**2/2 + a*g*x - b*d**2*f*n*log(d + e*x)/(2*e**2) + b*d*f*n*x/(2*e) + b*d*g*n*log(d + e*x)/e +
b*f*n*x**2*log(d + e*x)/2 - b*f*n*x**2/4 + b*f*x**2*log(c)/2 + b*g*n*x*log(d + e*x) - b*g*n*x + b*g*x*log(c),
Ne(e, 0)), ((a + b*log(c*d**n))*(f*x**2/2 + g*x), True))

________________________________________________________________________________________

Giac [B]  time = 1.2317, size = 251, normalized size = 2.76 \begin{align*} \frac{1}{2} \,{\left (x e + d\right )}^{2} b f n e^{\left (-2\right )} \log \left (x e + d\right ) -{\left (x e + d\right )} b d f n e^{\left (-2\right )} \log \left (x e + d\right ) - \frac{1}{4} \,{\left (x e + d\right )}^{2} b f n e^{\left (-2\right )} +{\left (x e + d\right )} b d f n e^{\left (-2\right )} +{\left (x e + d\right )} b g n e^{\left (-1\right )} \log \left (x e + d\right ) + \frac{1}{2} \,{\left (x e + d\right )}^{2} b f e^{\left (-2\right )} \log \left (c\right ) -{\left (x e + d\right )} b d f e^{\left (-2\right )} \log \left (c\right ) -{\left (x e + d\right )} b g n e^{\left (-1\right )} + \frac{1}{2} \,{\left (x e + d\right )}^{2} a f e^{\left (-2\right )} -{\left (x e + d\right )} a d f e^{\left (-2\right )} +{\left (x e + d\right )} b g e^{\left (-1\right )} \log \left (c\right ) +{\left (x e + d\right )} a g e^{\left (-1\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f+g/x)*x*(a+b*log(c*(e*x+d)^n)),x, algorithm="giac")

[Out]

1/2*(x*e + d)^2*b*f*n*e^(-2)*log(x*e + d) - (x*e + d)*b*d*f*n*e^(-2)*log(x*e + d) - 1/4*(x*e + d)^2*b*f*n*e^(-
2) + (x*e + d)*b*d*f*n*e^(-2) + (x*e + d)*b*g*n*e^(-1)*log(x*e + d) + 1/2*(x*e + d)^2*b*f*e^(-2)*log(c) - (x*e
 + d)*b*d*f*e^(-2)*log(c) - (x*e + d)*b*g*n*e^(-1) + 1/2*(x*e + d)^2*a*f*e^(-2) - (x*e + d)*a*d*f*e^(-2) + (x*
e + d)*b*g*e^(-1)*log(c) + (x*e + d)*a*g*e^(-1)